package com.orangelife.mobile.myhouse.biz;

import android.view.View;

/**
 * 用于View的setTag，无论是字符串、Map、List，都挺麻烦的
 * Created by 吴格非 on 2015/11/20.
 */
public class ViewTag {

    String[] arrValues;

    public ViewTag(String... args) {
        arrValues = args;
    }

    public String getValue() {
        return getValue(0);
    }

    public String getValue(int pos) {
        String value = "";
        if (pos < arrValues.length && pos >= 0) {
            value = arrValues[pos];
        }
        return value;
    }

    public int getIntValue() {
        return getIntValue(0);
    }

    public int getIntValue(int pos) {
        int value = 0;
        try {
            if (pos < arrValues.length && pos >= 0) {
                value = Integer.parseInt(arrValues[pos]);
            }
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return value;
    }
}
